Conversation
|
Hi @JacquesLeupin! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
This implementation routes measure through SchedulerDelegate to measure the mounted native view on the UI thread, and falls back to the existing shadow-tree values when native measurement isn’t possible. Note that on iOS/Android the callback may be invoked asynchronously (scheduled via the runtime scheduler) when the native-measure path is taken, which matches Paper’s callback-based semantics but may differ from Fabric’s previous “effectively synchronous” shadow-tree path. |
f8e40db to
6713027
Compare
Summary:
Fix Fabric
UIManager.measure/measureInWindowreturning shadow-tree coordinates on Android (and iOS), which breaksPressabilityhit regions when the native view is moving (e.g. native-driven animations).This fix is inspired by a potential solution proposed in #51621.
What changed
measure/measureInWindowthroughSchedulerDelegateso the platform can optionally measure the mounted native view on the UI thread.Viewbounds (incl. transforms) and report back to C++/JS.UIViewviaconvertRectand report back to C++/JS.Changelog:
[ANDROID] [FIXED] - Fabric
measure/measureInWindowuse mounted native view coordinates (fixes PressableonPressduring native-driven animations).[IOS] [FIXED] - Fabric
measure/measureInWindowuse mounted native view coordinates.Test Plan:
yarn test packages/react-native/Libraries/Pressability/__tests__/Pressability-test.jsonPressworks while the view is animating (Android + iOS)